<template>
  <button
    @click="loginHandle"
    class="submit"
  >
    <slot>按钮</slot>
  </button>
</template>

<script>
export default {
  methods: {
    loginHandle() {
      console.log("你点击了子组件的按钮");
      // 这里只需要触发父组件的自定义事件即可
      this.$emit("bb");
    },
  },
};
</script>

<style lang="less" scoped>
.submit {
  background-color: #cc3300;
  color: #fff;
  border: none;
  outline: none;
  width: 480/540 * 100vw;
  height: 65/540 * 100vw;
  display: block;
  border-radius: 100/540 * 100vw;
  margin-top: 60/540 * 100vw;
  font-size: 20/540 * 100vw;
}
</style>